#include<iostream>
#include<thread>
using namespace std;
void test1(const string& s)
{
	cout << s << endl;
}

void test2(int& x)
{
	x++;
}
int main()
{
	thread thread1(test1, "Hello Thread");
	//thread1.detach();
	//thread1.join();
	bool f = thread1.joinable();
	if (f) {
		thread1.join();	 
	}
	int a = 1;
	thread thread2(test2, ref(a));
	f = thread2.joinable();
	if (f) {
		thread2.join();
	}
	cout << "a==" << a << endl;
	return 0;
}